package com.jymj.enumEntity.yl;

/**
 * Created by ljj on 2017/5/3.
 * 建筑结构
 */
public enum BuStracEnum {
    //zero("其他", 0),
    one("简易房", 1),
    two("砖木结构", 2),
    three("钢筋混凝土结构", 3),
    four("钢结构", 4);
    // 成员变量
    private String name;
    private int index;

    // 构造方法
    private BuStracEnum(String name, int index) {
        this.name = name;
        this.index = index;
    }

    // 普通方法
    public static String getName(int index) {
        for (BuStracEnum s : BuStracEnum.values()) {
            if (s.getIndex() == index) {
                return s.name;
            }
        }
        return null;
    }

    // get set 方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }
}
